package com.belizer.demo.localDateTime;

import java.time.LocalDateTime;
import java.time.Month;

public class Demo {
    public static void main(String[] args) {
        // 2021-07-13 15:52:17
        LocalDateTime dateTime1 = LocalDateTime.of(2021, Month.JULY,13,15,52,17);
        LocalDateTime dateTime2 = LocalDateTime.of(2021, Month.OCTOBER,11,15,52,17);

        System.out.println("相差 = " + dateTime2.compareTo(dateTime1));


        LocalDateTime now = LocalDateTime.now();
        System.out.println("3个月前 = " + (now.minusMonths(3L)) );
        System.out.println("90天前 = " + (now.minusDays(90L)) );
    }
}
